perm filename MANUAL.TEX[WEB,ALS] blob sn#687570 filedate 1982-12-03 generic text, type T, neo UTF8
\chapterbegin Chapter 4. Fonts\\of Type

Occasionally you will want to change from one ↑{typeface} to another, for
example if you wish to be {\bf ↑{bold}} or to {\sl emphasize\/} something.
\TeX\ deals with sets of up to 256 characters called ``↑{fonts}'' of type,
and control sequences are used to select a particular font. For example,
you could specify the last few words of the first sentence above
in the following way, using the plain \TeX\ format of Appendix@B:
\ttbegin
to be \bf bold \rm or to \sl emphasize \rm something.
\ttend
Plain \TeX\ provides the following control sequences for changing fonts:
$$\halign{\indent#\hfil\qquad&#\hfil\cr
  |\rm| switches to the normal ``roman'' typeface:&Roman\cr
  |\sl| switches to a slanted roman typeface:&\sl Slanted\cr
  |\it| switches to italic style:&\it Italic\cr
  |\tt| switches to a typewriter-like face:&\tt Typewriter\cr
  |\bf| switches to an extended boldface style:&\bf Bold\cr}$$
↑(:rm)↑(:sl)↑(:it)↑(:tt)↑(:bf)↑(typewriter type)
At the beginning of a run you get roman type (|\rm|) unless you specify
otherwise.

Notice that two of these faces have an ``↑{oblique}'' slope for emphasis:
{\sl ↑{Slanted type} is essentially the same as roman, but the letters are
slightly skewed, \it while the letters in ↑{italic type} are drawn in a
different style.} \ (You can perhaps best appreciate the difference between
the roman and italic styles by contemplating {\tenu letters that are
in an unslanted italic face.}) \ Typographic conventions are presently
in a state of transition, because new technology has made it possible to
do things that used to be prohibitively expensive; people are wrestling
with the question of how much to use their new-found typographic freedom.
Slanted roman type was introduced in the 1930s, but it first become widely
used as an alternative to the conventional italic during the late 1970s.
It can be beneficial in mathematical texts, since slanted
letters are distinguishable from the italic letters in math formulas;
the double use of italic type for two different purposes---for example,
when statements of theorems are italicized as well as the names of variables in
those theorems---has led to some confusion, which can now be
avoided with slanted type. People are not generally agreed about the relative
merits of slanted versus italic, but slanted type is rapidly becoming a
favorite for the titles of books and journals in bibliographies.

Special fonts are effective for emphasis, but not for sustained reading;
your eyes would tire if long portions of this manual were entirely set in
a bold or slanted or italic face. Therefore roman type accounts for the
bulk of most typeset material. But it's a nuisance to say `|\rm|' every
time you want to go back to the roman style, so \TeX\ provides an easier
way to do it, using ``↑{curly brace}↑(brace)'' symbols: You can switch
fonts inside the special symbols |{| and |}|, without affecting the fonts
outside. For example, the displayed phrase at the beginning of this
chapter is usually rendered
\ttbegin
to be {\bf bold} or to {\sl emphasize} something.
\ttend
This is a special case of the general idea of ``↑{grouping}'' that we shall
discuss in the next chapter. It's best to forget about the first way of
changing fonts, and to use grouping instead; then your \TeX\ manuscripts
will look more natural, and you'll probably
never\footnote*{Well $\ldotss$, hardly ever.} have to type `|\rm|'.

\exercise Explain how to type the bibliographic reference `Ulrich ↑{Dieter},
{\sl Journal f\"ur die reine und angewandte Mathematik\/\ \bf201} (1959),
37--70'. [Use grouping.]
\answer |Ulrich Dieter, {\sl Journal f\"ur die reine und angewandte
Mathematik\/\ \bf201} (1959), 37--70|'. \ (It's convenient to use a single
group for both |\sl| and |\bf| here. The `\hbox{|\/\ |}' is a refinement
that you might not understand until reading the rest of Chapter@4.)

\exercise Suppose that you have typed a manuscript using slanted type for
emphasis, but your editor suddenly tells you to change all the slanted to
italic.  What's an easy way to do this?
\answer Just |\let\sl=\it| at the beginning.

We have glossed over an important aspect of quality in the preceding
discussion. Look, for example, at the {\it italicized} and {\sl slanted}
words in this sentence. Since italic and slanted styles slope to the right,
the d's stick into the spaces that separate these words from the roman
type that follows; as a result, the spaces appear to be too skimpy,
although they are correct at the baseline. To equalize the effective white
space, \TeX\ allows you to put the special control sequence `↑{*/}' just
before switching back to unslanted letters. When you type
\ttbegin
{\it italicized\/} and {\sl slanted\/} words
\ttend
you get {\it italicized\/} and {\sl slanted\/} words that look better.
The `|\/|' tells \TeX\ to add an\linebreak % makes the line tighter, to be fair
``{\sl↑{italic correction}\/}'' to the
previous letter, depending on that letter; this correction is about four
times as much for an `$f$' as for a `$c$', in a typical italic font.

Sometimes the italic correction is not desirable, because other factors take
up the visual slack. The standard rule of thumb is to use |\/| just before
switching from slanted or italic to roman or bold, unless the next
character is a period or comma. For example, type
\ttbegin
{\it italics\/} for {\it emphasis}.
\ttend

\exercise Suppose you don't believe in (or don't know about) grouping, and
you type `|\it italicized\/ \rm words|'. What's wrong with that, and how
should it be patched up?
\answer The spaces after control sequences |\/| and |\rm| are ignored, so
you get `\it italicized\/ \rm words'. To fix this, either type
`|\it italicized\/\ \rm words|' or (better) use grouping.

\danger Every letter of every font has an italic correction, which you can
bring to life by typing |\/|. The correction is usually zero in unslanted
styles, but there are exceptions: To typeset a bold `{\bf f\/}' in quotes,
you should say |a| |bold| \hbox{|`{\bf f\/}'|}, lest you get a bold `{\bf f}'.

\ddangerexercise Define a control sequence |\ic| such that `|\ic c|' puts the
italic correction of character $c$ into \TeX's register |\dimen0|.
\answer |\def\ic#1{\setbox0=\hbox{#1\/} \setdimen0=1wd0|\hfil\linebreak
|\setbox0=\hbox{#1} \advdimen0 by -1wd0}|.

Fonts vary in size as well as in shape. For example, the font you are now
reading is called a ``10-point'' font, because certain features of its
design are 10 ↑{points} apart, when measured in printers' units. \ (We
will study the point system later; for now, it should suffice to point out
that the parentheses around this sentence are exactly 10 points tall---and
the em-dash is just 10 points wide.) \ The ``↑{dangerous bend}''
sections of this manual are set in 9-point type, the foot\-notes in 8-point,
subscripts in 7-point or 6-point, sub-subscripts in 5-point.

Each font used in a \TeX\ manuscript is associated with a control sequence;
for example, the 10-point font in this paragraph is called ↑{:tenrm}, and
the corresponding 9-point font is called ↑{:ninerm}. The slanted fonts that
match |\tenrm| and |\ninerm| are called ↑{:tensl} and ↑{:ninesl}. These
control sequences are not built into \TeX, nor are they the actual names
of the fonts; \TeX\ users are just supposed to make up convenient names,
whenever new fonts are introduced into a manuscript. Such control
sequences are used to change typefaces.

When fonts of different sizes are used simultaneously, \TeX\ will line the
letters up according to their ``↑{baseline}s.'' For example, if you type
\ttbegin
\tenrm smaller \ninerm and smaller
\eightrm and smaller \sevenrm and smaller
\sixrm and smaller \fiverm and smaller \tenrm
\ttend
the result is {smaller \ninerm and smaller \eightrm and smaller
\sevenrm and smaller \sixrm and smaller \fiverm and smaller}. Of course
this is something that authors and readers aren't accustomed to, because
printers couldn't do such things with traditional lead types. Perhaps
poets who wish to speak in {\fiverm a still small voice} will cause future
books to make use of frequent font variations, but nowadays it's only
an occasional font freak {\fiverm(like the author of this manual)} who
likes such experiments. One should not get too carried away by the prospect
of font switching unless there is good reason.

An alert reader might well be confused at this point because we started out
this chapter by saying that `|\rm|' is the command that switches to roman
type, but later on we said that `|\tenrm|' is the way to do it. The truth
is that both ways work. But it has become customary to set things up so that
|\rm| means ``switch to roman type in the current size'' while |\tenrm| means
``switch to roman type in the 10-point size.'' In plain \TeX\ format, nothing
but 10-point fonts are provided, so |\rm| will always get you |\tenrm|; but
in more complicated formats the meaning of |\rm| will change in different
parts of the manuscript. For example, in the format used by the author to
typeset this manual, there's a control sequence `↑{:tenpoint}' that causes
|\rm| to mean |\tenrm|, |\sl| to mean |\tensl|, and so on, while
`↑{:ninepoint}' changes the definitions so that |\rm| means |\ninerm|,
etc. There's another control sequence used to introduce the quotations at
the end of each chapter; when the quotations are typed, |\rm| and |\sl|
temporarily stand for {\eightss 8-point unslanted sans-serif type} and
{\eightsss 8-point slanted sans-serif type}, respectively. This device of
constantly redefining the abbreviations |\rm| and |\sl|, behind the
scenes, frees the typist from the need to remember what size or style of
type is currently being used.

\exercise Why do you think the author chose the names `|\tenpoint|' and
`|\tenrm|', etc., instead of `|\10point|' and `|\10rm|'\thinspace?
\answer Control sequence names are made of letters, not digits.

\danger Each font has an external name that identifies it with respect to
all other fonts in a particular library. For example, the font in this
sentence is called `|cmr9|', which is an abbreviation for ``↑{Computer
Modern} Roman 9@point.'' ↑(cm fonts) In order to prepare \TeX\ for
using this font, the command
\ttbegin
\font\ninerm=cmr9
\ttend
appears in Appendix E\null. In general you say `↑{*font}|\cs=|\<external font
name>' to load the information about a particular font into \TeX's memory;
afterwards the control sequence |\cs| will select that font for typesetting.
Plain \TeX\ makes only a few fonts available initially, but you can use
|\font| to access anything in your system's font library.

\danger It is often possible to use a font at several different sizes, by
magnifying or shrinking the character images. Each font has a so-called
↑{design size}, which reflects the size it normally has by default; for
example, the design size of |cmr9| is 9@points. But on many systems there is
also a range of sizes at which you can use a particular font, by scaling its
dimensions up or down. To load a scaled font into \TeX's memory, you
simply say `|\font\cs=|\<external font name> ↑{.at} \<desired size>'.
For example,
\ttbegin
\font\magnifiedfiverm=cmr5 at 10pt
\ttend
brings in 5-point Computer Modern Roman at twice its normal size. \ (Caution:
Before using this `|at|' feature, you should check to make sure that your
typesetter supports the font at the size in question; \TeX\ will accept any
\<desired size> that is positive and less than 2048 points, but the final
output will not be right unless the scaled font really exists.)

\danger What's the difference between |cmr5| |at| |10pt| and the normal
10-point font, |cmr10|? Plenty; a well-designed font will be drawn
differently at different point sizes, and the letters will often have
different relative heights and widths, in order to enhance readability.
$$\dbox{\tenrm Ten point type is different from
  \magnifiedfiverm magnified five-point type.%
  \hskip 0pt plus 1fil minus 25pt}$$
Therefore it is usually best to scale fonts only slightly with respect to
their design size, unless the final product is going to be photographically
reduced after \TeX\ has finished with it, or unless you are trying for an
unusual effect.↑(magnification)↑(reduction)

\dangerexercise B. L. User wanted to load font |oldenglish10| and to select
it immediately, so he wrote
\ttbegin
\font\old=oldenglish10
\old
\ttend
But \TeX\ balked at the second line, claiming that |\old| was an undefined
control sequence. Can you explain what went wrong?
\answer \TeX\ encountered |\old| while looking for an `|at|' clause; at this
point |\old| was not yet defined. \ (One way to cure this is to say |\relax|
before the second |\old|. But it's usually preferable to group all |\font|
definitions together before selecting any of them, so that you can see at
a glance which fonts are present.)

\chapterend

Type faces---like people's faces---have distinctive features
indicating aspects of character. % I don't think he was kidding
\author MARSHALL ↑{LEE}, {\sl Bookmaking\/} (1965) % page 83

\bigskip

This was the noblest Roman of them all.
\author WILLIAM ↑{SHAKESPEARE}, {\oldeightsss Julius C\ae sar\/} %
  (Act V, Scene 5) % line 68

\eject